package com.wcar.sale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 金额明细
 * @TableName tb_user_detail
 */
@TableName(value ="tb_user_detail")
@Data
public class UserDetail implements Serializable {
    /**
     * 明细ID
     */
    @TableId(value = "detail_id")
    private String detail_id;

    /**
     * 外键，关联用户ID
     */
    @TableField(value = "user_id")
    private Integer user_id;

    /**
     * 支出金额
     */
    @TableField(value = "expenditure")
    private Integer expenditure;

    /**
     * 实际充值金额
     */
    @TableField(value = "recharge_money")
    private BigDecimal recharge_money;

    /**
     * 优惠金额
     */
    @TableField(value = "discounts_money")
    private BigDecimal discounts_money;

    /**
     * 实际到账金额 (实际充值金额+优惠金额)
     */
    @TableField(value = "account_money")
    private Integer account_money;

    /**
     * 充值时间
     */
    @TableField(value = "recharge_time")
    private LocalDateTime recharge_time;

    /**
     * 支出时间
     */
    @TableField(value = "expenditure_time")
    private LocalDateTime expenditure_time;

    /**
     * 外键关联门店id
     */
    @TableField(value = "store_id")
    private Integer store_id;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserDetail other = (UserDetail) that;
        return (this.getDetail_id() == null ? other.getDetail_id() == null : this.getDetail_id().equals(other.getDetail_id()))
            && (this.getUser_id() == null ? other.getUser_id() == null : this.getUser_id().equals(other.getUser_id()))
            && (this.getExpenditure() == null ? other.getExpenditure() == null : this.getExpenditure().equals(other.getExpenditure()))
            && (this.getRecharge_money() == null ? other.getRecharge_money() == null : this.getRecharge_money().equals(other.getRecharge_money()))
            && (this.getDiscounts_money() == null ? other.getDiscounts_money() == null : this.getDiscounts_money().equals(other.getDiscounts_money()))
            && (this.getAccount_money() == null ? other.getAccount_money() == null : this.getAccount_money().equals(other.getAccount_money()))
            && (this.getRecharge_time() == null ? other.getRecharge_time() == null : this.getRecharge_time().equals(other.getRecharge_time()))
            && (this.getExpenditure_time() == null ? other.getExpenditure_time() == null : this.getExpenditure_time().equals(other.getExpenditure_time()))
            && (this.getStore_id() == null ? other.getStore_id() == null : this.getStore_id().equals(other.getStore_id()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDetail_id() == null) ? 0 : getDetail_id().hashCode());
        result = prime * result + ((getUser_id() == null) ? 0 : getUser_id().hashCode());
        result = prime * result + ((getExpenditure() == null) ? 0 : getExpenditure().hashCode());
        result = prime * result + ((getRecharge_money() == null) ? 0 : getRecharge_money().hashCode());
        result = prime * result + ((getDiscounts_money() == null) ? 0 : getDiscounts_money().hashCode());
        result = prime * result + ((getAccount_money() == null) ? 0 : getAccount_money().hashCode());
        result = prime * result + ((getRecharge_time() == null) ? 0 : getRecharge_time().hashCode());
        result = prime * result + ((getExpenditure_time() == null) ? 0 : getExpenditure_time().hashCode());
        result = prime * result + ((getStore_id() == null) ? 0 : getStore_id().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", detail_id=").append(detail_id);
        sb.append(", user_id=").append(user_id);
        sb.append(", expenditure=").append(expenditure);
        sb.append(", recharge_money=").append(recharge_money);
        sb.append(", discounts_money=").append(discounts_money);
        sb.append(", account_money=").append(account_money);
        sb.append(", recharge_time=").append(recharge_time);
        sb.append(", expenditure_time=").append(expenditure_time);
        sb.append(", store_id=").append(store_id);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}